Skip to main content

Testing different image augmentation

The following runs are used to evaluate which model configuration perform better. The average F1 and F2 scores of the 10 runs are used as the evaluation metric.

The ten runs have different training datasets and testing datasets. The idea of splitting the run into 10 runs is because I want to see how the model configuration performs on different testing dataset. The idea is similar to k-fold cross validation, where each fold has trained on the different training dataset and validated on the different validation datasets. The reason why I train the model this way instead of the actual k-fold cross-validation is that I want to make sure that the testing datasets consist of images that the model has never seen before (images from different videos) since multiple frames from the same video are similar to each other, and those frames can be ended up in testing and validation datasets resulting in a high validation score.

The ten runs are used to evaluate the different model configuration. The actual model for each model configuration is a model trained and validated using the all dataset.

For the model I used in the fine-tuning, I created a new model that used all datasets (including the testing dataset) in training and validation. For the DVN resnet 50 model I used in the fine-tuning with SD1, I created a model using all images from the dataset.

Deven commented that we cannot evaluate this way because there was no control. The test dataset will need to be the same.

Sharpen vs No Sharpen runs

The baseline model's config:

  • Backbone: ResNet50
  • Image argumentation: Resize((470, 700),method='squish', pad_mode='zeros')
  • Batch Size: 32
  • Epoch: 10
  • Metric threshold = 0.5

The sharpen model's config:

  • Backbone: ResNet50
  • Image argumentation: '[Resize((470, 700),method='squish', pad_mode='zeros'), SharpenTransform(50)]
  • Batch Size: 32
  • Epoch: 10
  • Metric threshold = 0.5

The table compares the performance of baseline model to the sharpen model. The comparison is done across the column. Each row represents the results of the two models trained on one training dataset and tested on one testing dataset.

Train dataF1 normalF1 average (no ND)F2 average (no ND)
baselinesharpenbaselinesharpenbaselinesharpenLabel in test dataset
390.96260.9660.55140.45840.53230.4311['ND', 'TB', 'TBA', 'AMH']
400.87760.88330.29010.34490.25540.3221['ND', 'TB', 'TBA', 'AMH']
410.97080.97210.12690.15320.11780.1471['ND', 'TB', 'TBB', 'TBA', 'AMH']
4210.9864N/AN/AN/AN/A['ND']
430.98810.98570.91360.60640.88360.593['ND', 'TF', 'TB', 'AMH']
440.99790.98670.56680.46550.54640.4561['ND', 'TF', 'AMH']
450.89380.91270.34420.41360.34850.4354['ND', 'TBA', 'TB', 'AMH', 'RFJ']
460.93610.94020.54510.61850.47830.5604['ND', 'DAGS', 'TB', 'AMH']
470.95760.93710.68410.62220.6510.5687['ND', 'TB', 'DAGS', 'AMH']
480.97120.94890.28610.25450.27080.26['ND', 'TB', 'AMH', 'DAGS', 'TBB', 'SSS', 'TBA']
Average0.955570.951910.47870.4374666670.4537888890.419

No sharpen: Threshold = 0.50 vs Threshold = 0.30

Run IDF1 normalF1 average (no ND)F2 average (no ND)
thres=0.5thres=0.3thres=0.5thres=0.3thres=0.5thres=0.3Label in test dataset
390.96260.95760.55140.54930.53230.537['ND', 'TB', 'TBA', 'AMH']
400.87760.86390.29010.32920.25540.3041['ND', 'TB', 'TBA', 'AMH']
410.97080.96710.12690.12790.11780.1189['ND', 'TB', 'TBB', 'TBA', 'AMH']
4211N/AN/AN/AN/A['ND']
430.98810.98530.91360.95140.88360.9549['ND', 'TF', 'TB', 'AMH']
440.99790.99690.56680.70460.54640.6549['ND', 'TF', 'AMH']
450.89380.89340.34420.33020.34850.3418['ND', 'TBA', 'TB', 'AMH', 'RFJ']
460.93610.93310.54510.56510.47830.5098['ND', 'DAGS', 'TB', 'AMH']
470.95760.960.68410.67090.6510.6574['ND', 'TB', 'DAGS', 'AMH']
480.97120.96350.28610.2840.27080.2738['ND', 'TB', 'AMH', 'DAGS', 'TBB', 'SSS', 'TBA']
Average0.955570.952080.47870.50140.4537888890.483622222

Sharpen: Threshold = 0.50 vs Threshold = 0.30

Run IDF1 normalF1 average (no ND)F2 average (no ND)
thres=0.5thres=0.3thres=0.5thres=0.3thres=0.5thres=0.3Label in test dataset
390.9660.96280.45840.47050.43110.4516['ND', 'TB', 'TBA', 'AMH']
400.88330.8670.34490.36240.32210.345['ND', 'TB', 'TBA', 'AMH']
410.97210.97160.15320.15340.14710.1486['ND', 'TB', 'TBB', 'TBA', 'AMH']
420.98640.9898N/AN/AN/AN/A['ND']
430.98570.98250.60640.73350.5930.7002['ND', 'TF', 'TB', 'AMH']
440.98670.98570.46550.47460.45610.4698['ND', 'TF', 'AMH']
450.91270.91020.41360.40760.43540.4428['ND', 'TBA', 'TB', 'AMH', 'RFJ']
460.94020.93540.61850.64350.56040.5815['ND', 'DAGS', 'TB', 'AMH']
470.93710.93670.62220.65940.56870.6084['ND', 'TB', 'DAGS', 'AMH']
480.94890.94560.25450.25460.260.2656['ND', 'TB', 'AMH', 'DAGS', 'TBB', 'SSS', 'TBA']
Average0.951910.948730.4374666670.4621666670.4193222220.445944444

No sharpen: No additional image transforms vs Additional image transforms (Flip(), Brightness(), Warp(), Rotate())

Run IDF1 normalF1 average (no ND)F2 average (no ND)
no additional image transformaddition image transformsno additional image transformaddition image transformsno additional image transformaddition image transformsLabel in test dataset
390.96260.97230.55140.48190.53230.5323['ND', 'TB', 'TBA', 'AMH']
400.87760.88490.29010.36650.25540.356['ND', 'TB', 'TBA', 'AMH']
410.97080.9710.12690.14630.11780.141['ND', 'TB', 'TBB', 'TBA', 'AMH']
4210.9932N/AN/AN/AN/A['ND']
430.98810.99330.91360.7620.88360.7281['ND', 'TF', 'TB', 'AMH']
440.99790.99790.56680.99180.54640.9967['ND', 'TF', 'AMH']
450.89380.9120.34420.40760.34850.4428['ND', 'TBA', 'TB', 'AMH', 'RFJ']
460.93610.93250.54510.58290.47830.5293['ND', 'DAGS', 'TB', 'AMH']
470.95760.94020.68410.63780.6510.6076['ND', 'TB', 'DAGS', 'AMH']
480.97120.95750.28610.26140.27080.2483['ND', 'TB', 'AMH', 'DAGS', 'TBB', 'SSS', 'TBA']
Average0.955570.955480.47870.5153555560.4537888890.509122222

Sharpen: No additional image transforms vs Additional image transforms (Flip(), Brightness(), Warp(), Rotate())

Run IDF1 normalF1 average (no ND)F2 average (no ND)
no additional image transformaddition image transformsno additional image transformaddition image transformsno additional image transformaddition image transformsLabel in test dataset
390.9660.94270.45840.45780.43110.4223['ND', 'TB', 'TBA', 'AMH']
400.88330.91310.34490.39160.32210.3683['ND', 'TB', 'TBA', 'AMH']
410.97210.97180.15320.15470.14710.1506['ND', 'TB', 'TBB', 'TBA', 'AMH']
420.98640.9864N/AN/AN/AN/A['ND']
430.98570.98990.60640.92340.5930.8983['ND', 'TF', 'TB', 'AMH']
440.98670.98670.46550.46550.45610.4561['ND', 'TF', 'AMH']
450.91270.91270.41360.41360.43540.4354['ND', 'TBA', 'TB', 'AMH', 'RFJ']
460.94020.94020.61850.61850.56040.5604['ND', 'DAGS', 'TB', 'AMH']
470.93710.93710.62220.62220.56870.5687['ND', 'TB', 'DAGS', 'AMH']
480.94890.94890.25450.25450.260.26['ND', 'TB', 'AMH', 'DAGS', 'TBB', 'SSS', 'TBA']
Average0.951910.952950.4374666670.4779777780.4193222220.457788889

Colour vs Black&White

  • The following image augmentations were applied to
    • colour runs: Resize((470, 700),method='squish', pad_mode='zeros'); [Flip(),Brightness(), Warp(), Rotate()]
    • BW runs: ImageBlock(cls=PILImageBW);Resize((470, 700),method='squish', pad_mode='zeros'); [Flip(),Brightness(), Warp(), Rotate()]
Run IDF1 normalF1 average (no ND)F2 average (no ND)Label in test dataset
colourBWcolourBWcolourBW
390.9720.9610.5320.5610.5320.540['ND', 'TB', 'TBA', 'AMH']
400.8850.8430.3560.2430.2550.216['ND', 'TB', 'TBA', 'AMH']
410.9710.9680.1410.1570.1180.139['ND', 'TB', 'TBB', 'TBA', 'AMH']
420.9930.993N/AN/A['ND']
430.9930.9840.7280.5830.8840.572['ND', 'TF', 'TB', 'AMH']
440.9980.9980.9970.4920.5460.497['ND', 'TF', 'AMH']
450.9120.9100.4430.3630.3490.361['ND', 'TBA', 'TB', 'AMH', 'RFJ']
460.9330.9300.5290.5070.4780.456['ND', 'DAGS', 'TB', 'AMH']
470.9400.9400.6080.6810.6510.648['ND', 'TB', 'DAGS', 'AMH']
480.9580.9580.2480.2430.2710.224['ND', 'TB', 'AMH', 'DAGS', 'TBB', 'SSS', 'TBA']
Average0.9550.9480.5090.4260.4540.406